
<?php if ($action == 'update'): ?>
    <?php if ($model->salesordersorg != NULL): ?>
        <li><a class="return-button" href="javascript:void(0)" onclick="save({link:'index.php?r=invoices/update&invoice=<?= $model->salesordersorg ?>'})">Save & Return</a></li>
    <?php endif ?>
    <li><a class="save-button"  href="javascript:void(0)" onclick="save(null);">Save</a></li>
    <li><a class="cancel-button"  href="index.php?r=invoices/cancel&invoice=<?= $model->invoice ?>">Cancel</a></li>
    <li><a class="delete-button"  href="index.php?r=invoices/cancel&delete=1&invoice=<?= $model->invoice ?>"
           onclick="return confirm('Are you sure to delete this item?')">Delete</a></li>
    <br/>

    <li><a class="print-button" href="javascript:void(0)" onclick="save({link:'index.php?r=pdf&invno=<?= $model->invoice ?>',newtab:true,print:true})">View/Print</a></li>
   <?php if($model->location->disableemails): ?>
    <li><a  class="email-button"  href="#" id="mailForm" onclick="">E-Mail</a></li>
    <?php else: ?>
       <li><a  class="email-button"  href="#" id="mailEmpForm" onclick="">E-Mail</a></li>
    <?php endif; ?>
<li><a class="return-button" href="javascript:void(0)" onclick="save({link:'index.php?r=invoices/update&invoice=<?=$model->invoiceorg?>' })" id="ext-gen1135">Back to Invoice</a></li>
    <br/>
   
<?php elseif ($action == 'view'): ?>

    <li><a class="delete-button"  href="index.php?r=invoices/cancel&delete=1&invoice=<?= $model->invoice ?>"
           onclick="return confirm('Are you sure to delete this item?')">Delete</a></li>
    <li><a class="print-button" target="_blank" onclick="printSelect({link:'index.php?r=pdf&invno=<?= $model->invoice ?>',newtab:true})" >View/Print</a>
       <?php if($model->location->disableemails): ?>
    <li><a  class="email-button"  href="#" id="mailForm" onclick="">E-Mail</a></li>
    <?php else: ?>
       <li><a  class="email-button"  href="#" id="mailEmpForm" onclick="">E-Mail</a></li>
    <?php endif; ?>
<li><a class="return-button" href="javascript:void(0)" onclick="save({link:'index.php?r=invoices/update&invoice=<?=$model->invoiceorg?>' })" id="ext-gen1135">Back to Invoice</a></li>
    <br/>

  
<?php endif; ?>
